<!DOCTYPE html>
<html lang="en">
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>修改地址</title>
    <link rel="stylesheet" href="/js/bootstrap.min.css">
    <script src="/js/jquery-3.2.1.min.js"></script>
    <script src="/js/bootstrap.min.js"></script>
    <script type="text/javascript">
        $(function () {
            $("#button").click(function () {
                //保存信息
                var newProduct = $("#addForm form")[0];
                var formaDate = new FormData(newProduct);
                $.ajax({
                    url: "/applets/address/update",
                    type: "post",
                    data: formaDate,
                    cache: false,
                    contentType: false,
                    processData: false,
                    success: function (data) {
                        alert(data.msg);
                    }
                });
                return false;
            });
        });
    </script>
</head>
<body>
<div class="container" id="addForm">
    <h2 class="text-center">地址修改</h2>

    <!--导航-->
    <ul class="nav nav-tabs">
        <li class="nav-item">
            <a class="nav-link active" href="/KAddress/ShowAddress.html">返回展示界面</a>
        </li>
    </ul>
    <form action="#" method="post">
        <div class="form-group">
            <label>ID</label>
            <input type="text" name="id" class="form-control" th:value="${a.id}" hidden readonly>
        </div>
        <div class="form-group">
            <label>标签</label>
            <input type="text" name="tag" class="form-control" th:value="${a.tag}">
        </div>
        <div class="form-group">
            <label>地址</label>
            <input type="text" name="addr" class="form-control" th:value="${a.addr}">
        </div>
        <div class="form-group">
            <label>用户号</label>
            <input type="number" name="userid" class="form-control" th:value="${a.userid}" readonly>
        </div>
        <div class="form-group">
            <label>手机号</label>
            <input type="number" name="telephone" class="form-control" th:value="${a.telephone}">
        </div>
        <div class="form-group">
            <label>收件人</label>
            <input type="text" name="receivename" class="form-control" th:value="${a.receivename}">
        </div>
        <div class="form-group">
            <input type="button" id="button" class="form-control" value="提交">
        </div>
    </form>

</div>
</body>
</html>